package main

import "fmt"

func main() {
	a := []int{1,2,3}
	//a= a[2:] // 删除开头2个元素
	//a = append(a[:0], a[1:]...)//删除开头1个元素
	//display(a)
	//fmt.Println(a[1:])
	//TODO 从中间位置删除
	//a = append(a[:1], a[2:]...) //删除中间1个元素
	//display(a)
	//TODO 从尾部删除
	a = a[:len(a)-1]
	display(a)
	seq := [] string{"a", "b","c","d","e","f"}
	idx := 2
	fmt.Println(seq[:idx], seq[idx+1:])
	seq = append(seq[:idx], seq[idx+1:]...)
	fmt.Println(seq)
}

func display(a [] int)  {
	for k,v :=range a{
		fmt.Printf("index : %d, value : %d \n", k, v)
	}
}
